<?php
/**
 * @Copyright Copyright (C) 2010-2012
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 + Created by:          Webit Solution
 * Company:		Webit Solution
 + Contact:		www.webits.asia, developer@webits.asia
 * Created on:	Mar 21, 2012
 ^
 + Project: 		WRecruit
 * File Name:	views/jobseeker/tmpl/jobsearch.php
 ^ 
 * Description: template for job search
 ^ 
 * History:		NONE
 ^ 
 */

defined('_JEXEC') or die('Restricted access');

jimport('joomla.html.pane');

$editor = & JFactory :: getEditor();

global $mainframe;
$version = new JVersion;
$joomla = $version->getShortVersion();
$jversion = substr($joomla,0,3);
$document = &JFactory::getDocument();
//$document->addScript( JURI::base() . '/includes/js/joomla.javascript.js');
$document->addStyleSheet('components/com_wrecruit/css/'.$this->config['theme']);
$document->addStyleSheet('components/com_wrecruit/css/chosen/chosen.css');
$document->addScript('components/com_wrecruit/js/chosen/chosen.jquery.js');

JHTML :: _('behavior.calendar');
$width_big = 40;
$width_med = 25;
$width_sml = 15;
$dateformat = $this->config['date_format'];
$firstdash = strpos($dateformat,'-',0);
$firstvalue = substr($dateformat, 0,$firstdash);
$firstdash = $firstdash + 1;
$seconddash = strpos($dateformat,'-',$firstdash);
$secondvalue = substr($dateformat, $firstdash,$seconddash-$firstdash);
$seconddash = $seconddash + 1;
$thirdvalue = substr($dateformat, $seconddash,strlen($dateformat)-$seconddash);
$js_dateformat = '%'.$firstvalue.'-%'.$secondvalue.'-%'.$thirdvalue;

$link_latest = 'index.php?option=com_wrecruit&c=wrecruit&view=jobseeker&layout=job_searchresults&Itemid='.$this->Itemid;
$link_browse = 'index.php?option=com_wrecruit&c=wrecruit&view=jobseeker&layout=browsejobs&jobcat=0&Itemid='.$this->Itemid;
?>

<div class="content-left">
    <div class="box-list">
        <div class="advance-search">
            <div class="head-title"><h2>Job advanced search</h2></div>
            <p class="quick-job">
                Quick jobs:
                <a href="<?php echo $link_latest?>&sortby=createddesc">Latest jobs</a>|
                <a href="#">Featured jobs</a>|
                <a href="<?php echo $link_browse?>&sortby=createddesc">Browse jobs</a>|
                <a href="#">your favorite jobs</a>
            </p>
            <form class="advance-search-form" action="<?php echo JRoute::_('index.php?option=com_wrecruit&c=wrecruit&view=jobseeker&layout=job_searchresults&Itemid='. $this->Itemid); ?>" method="post" name="adminForm" id="adminForm">
                <input type="hidden" name="isjobsearch" value="1" />
                <div class="form-row">
                    <input class="keyword-field" type="text" name="keyword" size="40" maxlength="255"  />
                    <p>Ex: Manager or sales, or Job reference number</p>
                </div>
                <div class="form-row">
                    <label for="jobcategory" class="label-field"><?php echo JText::_('Industry'); ?>:</label>
                    <?php echo $this->searchoptions['jobcategory']; ?>
                </div>
                <div class="form-row">
                    <label for="jobtype" class="label-field"><?php echo JText::_('JS_JOBTYPE'); ?>:</label>
                    <?php echo $this->searchoptions['jobtype']; ?>
                </div>
                <div class="form-row">
                    <label for="jobstatus" class="label-field"><?php echo JText::_('JS_JOBSTATUS'); ?>:</label>
                    <?php echo $this->searchoptions['jobstatus']; ?>
                </div>
                <div class="form-row salaryrange">
                    <label for="salaryrangefrom" class="label-field"><?php echo JText::_('Salary range($)'); ?>:</label>
                    <?php echo $this->searchoptions['salaryrangefrom']; ?>&nbsp;&nbsp;&nbsp;
                    <?php echo $this->searchoptions['salaryrangeto']; ?>&nbsp;&nbsp;&nbsp;
                    <?php echo $this->searchoptions['salaryrangetypes']; ?>&nbsp;&nbsp;&nbsp;
                </div>
                <div class="form-row">
                    <label for="country" class="label-field"><?php echo JText::_('Job location'); ?>:</label>
                    <?php echo $this->searchoptions['country']; ?>
                </div>
                <div class="form-row">
                    <label for="startpublishing" class="label-field"><?php echo JText::_('Job posted within'); ?>:</label>
                <?php
                    $jobs_posted = array('' => 'Select a period...', '0' => 'Today', '1' => 'Yesterday', '7' => 'Last Week', '15' => 'Last 15 days', '30' => 'Last Month');
                    echo JHTML::_('select.genericList', $jobs_posted, 'job_posted', 'class="inputbox dropdown-box" '. '', 'value', 'text', '');
                ?>
                </div>
       		<div class="form-row">
                    <label for="jobcareerlevel" class="label-field"><?php echo JText::_('Job degree/level'); ?>:</label>
                    <?php echo $this->searchoptions['jobcareerlevels']; ?>
                </div>
                <div class="submit-button">
                    <input type="submit" class="button" name="submit_app" onclick="document.adminForm.submit();" value="<?php echo JText::_('JS_SEARCH_JOB'); ?>" />
		</div>
	
                <input type="hidden" name="view" value="jobseeker" />
                <input type="hidden" name="layout" value="job_searchresults" />
                <input type="hidden" name="uid" value="<?php echo $this->uid; ?>" />
                <input type="hidden" name="option" value="<?php echo $this->option; ?>" />
                <input type="hidden" name="task11" value="view" />
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
	jQuery(document).ready(function(){
		jQuery("#jobcategory").chosen();
		jQuery("#country").chosen();
	});
</script>